package com.ssy.lingxi.platform.template.service.entity.adorn;

import com.ssy.lingxi.platform.template.service.handler.convert.JpaJsonToColumnBOConverter;
import com.ssy.lingxi.platform.template.service.model.bo.ColumnBO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * 模板关联导航栏 - DO
 * @author fhj
 * @date 2021/04/20
 * @version 2.0.0
 */
@Data
@Entity
@Table(schema = "public", name = "pt_page_template_column")
public class PageTemplateColumn {

    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="page_template_column_seq")
    @SequenceGenerator(sequenceName="pt_page_template_column_seq", name="page_template_column_seq", allocationSize = 1)
    @ApiModelProperty(value = "ID")
    private Long id;

    @Column(columnDefinition = "int8")
    @ApiModelProperty(value = "模板ID")
    private Long templateId;

    @Column(columnDefinition = "int8")
    @ApiModelProperty(value = "会员ID")
    private Long memberId;

    @Column(columnDefinition = "int8")
    @ApiModelProperty(value = "角色ID")
    private Long roleId;

    @Convert(converter = JpaJsonToColumnBOConverter.class)
    @Column(columnDefinition = "jsonb")
    @ApiModelProperty(value = "导航栏")
    private List<ColumnBO> columnBOList;

    @Column(columnDefinition = "int")
    @ApiModelProperty(value = "导航类型")
    private Integer type;
}
